<!doctype html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport"
        content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>
<body>
<script>
 let data =[
   {
     "createdBy": null,
     "createdTime": null,
     "updateBy": null,
     "updateTime": null,
     "createdById": null,
     "updateById": null,
     "taskId": 30995,
     "parentId": 0,
     "milepostId": 4339,
     "milepostName": "产品设计评审",
     "daysOfDelay": "21",
     "daysOfDelayNum": null,
     "projectId": 1515,
     "projectName": null,
     "description": null,
     "delFlag": 0,
     "taskName": "七月第一周产品设计、评审",
     "serialNumber": "1",
     "taskDependency": null,
     "taskOwner": "王喆",
     "taskParticipantList": [
       "王喆"
     ],
     "taskParticipantOthersList": null,
     "taskParticipantStr": "王喆",
     "taskParticipantOthersStr": null,
     "startTime": "2024-06-27",
     "endTime": "2024-07-01",
     "workingHours": 24,
     "taskType": "主任务",
     "assessor": 100258,
     "assessorName": "王喆",
     "priority": "HIGH",
     "priorityStr": "高",
     "actualStarTime": "2024-06-27",
     "taskFinishTime": "2024-07-02",
     "actualWorkHours": 16,
     "stateInput": "正常",
     "taskStatus": "完成",
     "instanceId": null,
     "ppmEnclosureInfoList": [],
     "attachment": "",
     "riskNumber": 0,
     "managerList": null,
     "carbonCopyNameList": null,
     "operationFlag": 1,
     "pmName": null,
     "plName": null,
     "taskStatusOnOrOff": true,
     "projectSwitch": "true",
     "taskAssignerName": null,
     "output": "否",
     "attachmentStatus": "true",
     "taskIndex": 1,
     "isRiskOrNo": false,
     "acceptanceCriteria": null,
     "nodeType": null,
     "mark": null,
     "taskSchedule": 100,
     "realTaskId": null,
     "taskExamStatus": null,
     "examFailNumber": null,
     "examPassTime": null,
     "children": null,
     "level": 1
   },
   {
     "createdBy": null,
     "createdTime": null,
     "updateBy": null,
     "updateTime": null,
     "createdById": null,
     "updateById": null,
     "taskId": 31335,
     "parentId": 0,
     "milepostId": 4339,
     "milepostName": "产品设计评审",
     "daysOfDelay": "16",
     "daysOfDelayNum": null,
     "projectId": 1515,
     "projectName": null,
     "description": null,
     "delFlag": 0,
     "taskName": "七月第二周产品设计、评审",
     "serialNumber": "1",
     "taskDependency": null,
     "taskOwner": "王喆",
     "taskParticipantList": [
       "王喆"
     ],
     "taskParticipantOthersList": null,
     "taskParticipantStr": "王喆",
     "taskParticipantOthersStr": null,
     "startTime": "2024-07-03",
     "endTime": "2024-07-06",
     "workingHours": 18,
     "taskType": "主任务",
     "assessor": 100258,
     "assessorName": "王喆",
     "priority": "HIGH",
     "priorityStr": "高",
     "actualStarTime": null,
     "taskFinishTime": null,
     "actualWorkHours": 0,
     "stateInput": "正常",
     "taskStatus": "延期",
     "instanceId": null,
     "ppmEnclosureInfoList": [],
     "attachment": null,
     "riskNumber": 0,
     "managerList": null,
     "carbonCopyNameList": null,
     "operationFlag": 1,
     "pmName": null,
     "plName": null,
     "taskStatusOnOrOff": true,
     "projectSwitch": "true",
     "taskAssignerName": null,
     "output": "否",
     "attachmentStatus": "true",
     "taskIndex": 2,
     "isRiskOrNo": false,
     "acceptanceCriteria": null,
     "nodeType": null,
     "mark": null,
     "taskSchedule": 0,
     "realTaskId": null,
     "taskExamStatus": null,
     "examFailNumber": null,
     "examPassTime": null,
     "children": null,
     "level": 1
   },
   {
     "createdBy": null,
     "createdTime": null,
     "updateBy": null,
     "updateTime": null,
     "createdById": null,
     "updateById": null,
     "taskId": 31105,
     "parentId": 0,
     "milepostId": 4361,
     "milepostName": "需求同步",
     "daysOfDelay": "19",
     "daysOfDelayNum": null,
     "projectId": 1515,
     "projectName": null,
     "description": null,
     "delFlag": 0,
     "taskName": "七月第一周需求同步",
     "serialNumber": "1.5",
     "taskDependency": null,
     "taskOwner": "王喆",
     "taskParticipantList": [
       "冯腾飞",
       "王喆",
       "朱婉钰",
       "秦玉国",
       "张梦杰",
       "杨宇晴"
     ],
     "taskParticipantOthersList": null,
     "taskParticipantStr": "冯腾飞,王喆,朱婉钰,秦玉国,张梦杰,杨宇晴",
     "taskParticipantOthersStr": null,
     "startTime": "2024-07-01",
     "endTime": "2024-07-03",
     "workingHours": 18,
     "taskType": "主任务",
     "assessor": 100258,
     "assessorName": "王喆",
     "priority": "HIGH",
     "priorityStr": "高",
     "actualStarTime": "2024-07-02",
     "taskFinishTime": null,
     "actualWorkHours": 4,
     "stateInput": "正常",
     "taskStatus": "延期",
     "instanceId": null,
     "ppmEnclosureInfoList": [],
     "attachment": null,
     "riskNumber": 0,
     "managerList": null,
     "carbonCopyNameList": null,
     "operationFlag": 1,
     "pmName": null,
     "plName": null,
     "taskStatusOnOrOff": true,
     "projectSwitch": "true",
     "taskAssignerName": null,
     "output": "否",
     "attachmentStatus": "true",
     "taskIndex": 1,
     "isRiskOrNo": false,
     "acceptanceCriteria": null,
     "nodeType": null,
     "mark": null,
     "taskSchedule": 0,
     "realTaskId": null,
     "taskExamStatus": null,
     "examFailNumber": null,
     "examPassTime": null,
     "children": null,
     "level": 1
   },
   {
     "createdBy": null,
     "createdTime": null,
     "updateBy": null,
     "updateTime": null,
     "createdById": null,
     "updateById": null,
     "taskId": 31096,
     "parentId": 0,
     "milepostId": 4360,
     "milepostName": "设计与开发",
     "daysOfDelay": "18",
     "daysOfDelayNum": null,
     "projectId": 1515,
     "projectName": null,
     "description": null,
     "delFlag": 0,
     "taskName": "UI设计及搭建",
     "serialNumber": "2",
     "taskDependency": null,
     "taskOwner": "朱婉钰",
     "taskParticipantList": [
       "朱婉钰"
     ],
     "taskParticipantOthersList": null,
     "taskParticipantStr": "朱婉钰",
     "taskParticipantOthersStr": null,
     "startTime": "2024-07-01",
     "endTime": "2024-07-04",
     "workingHours": 32,
     "taskType": "主任务",
     "assessor": 100258,
     "assessorName": "王喆",
     "priority": "HIGH",
     "priorityStr": "高",
     "actualStarTime": "2024-07-01",
     "taskFinishTime": null,
     "actualWorkHours": 11,
     "stateInput": "正常",
     "taskStatus": "延期",
     "instanceId": null,
     "ppmEnclosureInfoList": [],
     "attachment": null,
     "riskNumber": 0,
     "managerList": null,
     "carbonCopyNameList": null,
     "operationFlag": 1,
     "pmName": null,
     "plName": null,
     "taskStatusOnOrOff": true,
     "projectSwitch": "true",
     "taskAssignerName": null,
     "output": "否",
     "attachmentStatus": "true",
     "taskIndex": 1,
     "isRiskOrNo": false,
     "acceptanceCriteria": null,
     "nodeType": null,
     "mark": null,
     "taskSchedule": 0,
     "realTaskId": null,
     "taskExamStatus": null,
     "examFailNumber": null,
     "examPassTime": null,
     "children": null,
     "level": 1
   },
   {
     "createdBy": null,
     "createdTime": null,
     "updateBy": null,
     "updateTime": null,
     "createdById": null,
     "updateById": null,
     "taskId": 31098,
     "parentId": 0,
     "milepostId": 4360,
     "milepostName": "设计与开发",
     "daysOfDelay": "18",
     "daysOfDelayNum": null,
     "projectId": 1515,
     "projectName": null,
     "description": null,
     "delFlag": 0,
     "taskName": "第一周功能开发",
     "serialNumber": "2",
     "taskDependency": null,
     "taskOwner": "秦玉国",
     "taskParticipantList": [
       "秦玉国"
     ],
     "taskParticipantOthersList": null,
     "taskParticipantStr": "秦玉国",
     "taskParticipantOthersStr": null,
     "startTime": "2024-07-01",
     "endTime": "2024-07-04",
     "workingHours": 32,
     "taskType": "主任务",
     "assessor": 100283,
     "assessorName": "秦玉国",
     "priority": "HIGH",
     "priorityStr": "高",
     "actualStarTime": null,
     "taskFinishTime": null,
     "actualWorkHours": 0,
     "stateInput": "正常",
     "taskStatus": "延期",
     "instanceId": null,
     "ppmEnclosureInfoList": [],
     "attachment": null,
     "riskNumber": 0,
     "managerList": null,
     "carbonCopyNameList": null,
     "operationFlag": 1,
     "pmName": null,
     "plName": null,
     "taskStatusOnOrOff": true,
     "projectSwitch": "true",
     "taskAssignerName": null,
     "output": "否",
     "attachmentStatus": "true",
     "taskIndex": 2,
     "isRiskOrNo": false,
     "acceptanceCriteria": null,
     "nodeType": null,
     "mark": null,
     "taskSchedule": 0,
     "realTaskId": null,
     "taskExamStatus": null,
     "examFailNumber": null,
     "examPassTime": null,
     "children": null,
     "level": 1
   },
   {
     "createdBy": null,
     "createdTime": null,
     "updateBy": null,
     "updateTime": null,
     "createdById": null,
     "updateById": null,
     "taskId": 31126,
     "parentId": 0,
     "milepostId": 4360,
     "milepostName": "设计与开发",
     "daysOfDelay": "20",
     "daysOfDelayNum": null,
     "projectId": 1515,
     "projectName": null,
     "description": null,
     "delFlag": 0,
     "taskName": "日报提交时间",
     "serialNumber": "2",
     "taskDependency": null,
     "taskOwner": "冯腾飞",
     "taskParticipantList": [
       "秦玉国",
       "冯腾飞"
     ],
     "taskParticipantOthersList": null,
     "taskParticipantStr": "秦玉国,冯腾飞",
     "taskParticipantOthersStr": null,
     "startTime": "2024-07-01",
     "endTime": "2024-07-02",
     "workingHours": 16,
     "taskType": "主任务",
     "assessor": 100330,
     "assessorName": "冯腾飞",
     "priority": "HIGH",
     "priorityStr": "高",
     "actualStarTime": null,
     "taskFinishTime": null,
     "actualWorkHours": 0,
     "stateInput": "正常",
     "taskStatus": "审批中",
     "instanceId": "d52060fd-3915-11ef-ad40-12beb7c366fa",
     "ppmEnclosureInfoList": [],
     "attachment": "",
     "riskNumber": 0,
     "managerList": null,
     "carbonCopyNameList": null,
     "operationFlag": 0,
     "pmName": null,
     "plName": null,
     "taskStatusOnOrOff": true,
     "projectSwitch": "true",
     "taskAssignerName": null,
     "output": "否",
     "attachmentStatus": "true",
     "taskIndex": 3,
     "isRiskOrNo": false,
     "acceptanceCriteria": null,
     "nodeType": null,
     "mark": null,
     "taskSchedule": 0,
     "realTaskId": null,
     "taskExamStatus": null,
     "examFailNumber": null,
     "examPassTime": null,
     "children": null,
     "level": 1
   },
   {
     "createdBy": null,
     "createdTime": null,
     "updateBy": null,
     "updateTime": null,
     "createdById": null,
     "updateById": null,
     "taskId": 31137,
     "parentId": 0,
     "milepostId": 4360,
     "milepostName": "设计与开发",
     "daysOfDelay": "20",
     "daysOfDelayNum": null,
     "projectId": 1515,
     "projectName": null,
     "description": null,
     "delFlag": 0,
     "taskName": "过程分析表升级",
     "serialNumber": "2",
     "taskDependency": null,
     "taskOwner": "秦玉国",
     "taskParticipantList": [
       "秦玉国"
     ],
     "taskParticipantOthersList": null,
     "taskParticipantStr": "秦玉国",
     "taskParticipantOthersStr": null,
     "startTime": "2024-07-02",
     "endTime": "2024-07-02",
     "workingHours": 8,
     "taskType": "主任务",
     "assessor": 100283,
     "assessorName": "秦玉国",
     "priority": "HIGH",
     "priorityStr": "高",
     "actualStarTime": null,
     "taskFinishTime": "2024-07-03",
     "actualWorkHours": 0,
     "stateInput": "正常",
     "taskStatus": "完成",
     "instanceId": null,
     "ppmEnclosureInfoList": [],
     "attachment": "",
     "riskNumber": 0,
     "managerList": null,
     "carbonCopyNameList": null,
     "operationFlag": 1,
     "pmName": null,
     "plName": null,
     "taskStatusOnOrOff": true,
     "projectSwitch": "true",
     "taskAssignerName": null,
     "output": "否",
     "attachmentStatus": "true",
     "taskIndex": 4,
     "isRiskOrNo": false,
     "acceptanceCriteria": null,
     "nodeType": null,
     "mark": null,
     "taskSchedule": 100,
     "realTaskId": null,
     "taskExamStatus": null,
     "examFailNumber": null,
     "examPassTime": null,
     "children": null,
     "level": 1
   },
   {
     "createdBy": null,
     "createdTime": null,
     "updateBy": null,
     "updateTime": null,
     "createdById": null,
     "updateById": null,
     "taskId": 31328,
     "parentId": 0,
     "milepostId": 4360,
     "milepostName": "设计与开发",
     "daysOfDelay": "9",
     "daysOfDelayNum": null,
     "projectId": 1515,
     "projectName": null,
     "description": null,
     "delFlag": 0,
     "taskName": "行动项任务--绩效管理--过程分析表",
     "serialNumber": "2",
     "taskDependency": null,
     "taskOwner": "冯腾飞",
     "taskParticipantList": [
       "冯腾飞"
     ],
     "taskParticipantOthersList": null,
     "taskParticipantStr": "冯腾飞",
     "taskParticipantOthersStr": null,
     "startTime": "2024-07-03",
     "endTime": "2024-07-13",
     "workingHours": 56,
     "taskType": "主任务",
     "assessor": 100330,
     "assessorName": "冯腾飞",
     "priority": "HIGH",
     "priorityStr": "高",
     "actualStarTime": null,
     "taskFinishTime": null,
     "actualWorkHours": 0,
     "stateInput": "正常",
     "taskStatus": "延期",
     "instanceId": null,
     "ppmEnclosureInfoList": [],
     "attachment": null,
     "riskNumber": 0,
     "managerList": null,
     "carbonCopyNameList": null,
     "operationFlag": 0,
     "pmName": null,
     "plName": null,
     "taskStatusOnOrOff": true,
     "projectSwitch": "true",
     "taskAssignerName": null,
     "output": "否",
     "attachmentStatus": "true",
     "taskIndex": 5,
     "isRiskOrNo": false,
     "acceptanceCriteria": null,
     "nodeType": null,
     "mark": null,
     "taskSchedule": 0,
     "realTaskId": null,
     "taskExamStatus": null,
     "examFailNumber": null,
     "examPassTime": null,
     "children": null,
     "level": 1
   },
   {
     "createdBy": null,
     "createdTime": null,
     "updateBy": null,
     "updateTime": null,
     "createdById": null,
     "updateById": null,
     "taskId": 31139,
     "parentId": 0,
     "milepostId": 4370,
     "milepostName": "story测试",
     "daysOfDelay": "20",
     "daysOfDelayNum": null,
     "projectId": 1515,
     "projectName": null,
     "description": null,
     "delFlag": 0,
     "taskName": "过程分析表升级测试",
     "serialNumber": "5",
     "taskDependency": null,
     "taskOwner": "张梦杰",
     "taskParticipantList": [
       "张梦杰"
     ],
     "taskParticipantOthersList": null,
     "taskParticipantStr": "张梦杰",
     "taskParticipantOthersStr": null,
     "startTime": "2024-07-02",
     "endTime": "2024-07-02",
     "workingHours": 4,
     "taskType": "主任务",
     "assessor": 100328,
     "assessorName": "张梦杰",
     "priority": "HIGH",
     "priorityStr": "高",
     "actualStarTime": null,
     "taskFinishTime": null,
     "actualWorkHours": 0,
     "stateInput": "正常",
     "taskStatus": "延期",
     "instanceId": null,
     "ppmEnclosureInfoList": [],
     "attachment": null,
     "riskNumber": 0,
     "managerList": null,
     "carbonCopyNameList": null,
     "operationFlag": 1,
     "pmName": null,
     "plName": null,
     "taskStatusOnOrOff": true,
     "projectSwitch": "true",
     "taskAssignerName": null,
     "output": "否",
     "attachmentStatus": "true",
     "taskIndex": 1,
     "isRiskOrNo": false,
     "acceptanceCriteria": null,
     "nodeType": null,
     "mark": null,
     "taskSchedule": 0,
     "realTaskId": null,
     "taskExamStatus": null,
     "examFailNumber": null,
     "examPassTime": null,
     "children": null,
     "level": 1
   },
   {
     "createdBy": null,
     "createdTime": null,
     "updateBy": null,
     "updateTime": null,
     "createdById": null,
     "updateById": null,
     "taskId": 31136,
     "parentId": 0,
     "milepostId": 4368,
     "milepostName": "Story验收",
     "daysOfDelay": "20",
     "daysOfDelayNum": null,
     "projectId": 1515,
     "projectName": null,
     "description": null,
     "delFlag": 0,
     "taskName": "七月第一周第一次上线验收",
     "serialNumber": "9",
     "taskDependency": null,
     "taskOwner": "王喆",
     "taskParticipantList": [
       "王喆"
     ],
     "taskParticipantOthersList": null,
     "taskParticipantStr": "王喆",
     "taskParticipantOthersStr": null,
     "startTime": "2024-07-02",
     "endTime": "2024-07-02",
     "workingHours": 8,
     "taskType": "主任务",
     "assessor": 100258,
     "assessorName": "王喆",
     "priority": "HIGH",
     "priorityStr": "高",
     "actualStarTime": "2024-07-02",
     "taskFinishTime": "2024-07-03",
     "actualWorkHours": 6,
     "stateInput": "正常",
     "taskStatus": "完成",
     "instanceId": null,
     "ppmEnclosureInfoList": [],
     "attachment": "",
     "riskNumber": 0,
     "managerList": null,
     "carbonCopyNameList": null,
     "operationFlag": 1,
     "pmName": null,
     "plName": null,
     "taskStatusOnOrOff": true,
     "projectSwitch": "true",
     "taskAssignerName": null,
     "output": "否",
     "attachmentStatus": "true",
     "taskIndex": 1,
     "isRiskOrNo": false,
     "acceptanceCriteria": null,
     "nodeType": null,
     "mark": null,
     "taskSchedule": 100,
     "realTaskId": null,
     "taskExamStatus": null,
     "examFailNumber": null,
     "examPassTime": null,
     "children": null,
     "level": 1
   }
 ]
 function groupData(data) {
   let milepostName = ''
   if (!data || !data.length) {
     return []
   }
   return data.map((item, index) => {
     if (milepostName !== item.milepostName) {
       milepostName = item.milepostName
       let rowSpan = 0
       for (let i = 0; i < data.length; i++) {
         // if (i >= index) {
           if (milepostName === data[i].milepostName) {
             rowSpan += 1
           } else {
             break
           }
         // }
       }
       item.rowSpan = rowSpan
       item.border = index
     } else {
       item.rowSpan = 0
     }
     item.rowIndex = index
     return item
   })
 }
 console.log(groupData(data));
</script>
</body>
</html>